<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
<%@ page import="com.metier.IUtilisateurBasique" %>
<%@ page import="com.metier.IExperience" %>
<%@ page import="com.metier.IOutils" %>
<%@ page import="java.util.ArrayList" %>

<head>
<script type="text/javascript" src="/Contacto/pages/js/experience.js" charset="utf-8" >	
</script>
</head>

<%

 String id =request.getParameter("id");
 String idExp =request.getParameter("numExp");
 
 IOutils outils = (IOutils) request.getSession().getServletContext().getAttribute("Outils");

 	IUtilisateurBasique utilisateur = (IUtilisateurBasique)request.getSession().getAttribute("Utilisateur");
 	IExperience experience = utilisateur.getExperience(Integer.valueOf(idExp));
 	Long tempDebut=experience.getDebut();
 	Long tempFin=experience.getFin();
 	String checked = "";
 	String disable = "";
 	int anneeFin=0;
 	int moiFin=0;
 	if(experience.isActuel()){
 		checked="checked='yes'";
 		disable="disabled='true'";
 	} 
 	
 	int anneeDebut=experience.getAnneeParDonneeDeBD(tempDebut); 
 	int moiDebut=experience.getMoiParDonneeDeBD(tempDebut);
 	
 	if(!experience.isActuel()){
 		anneeFin=experience.getAnneeParDonneeDeBD(tempFin);
 		moiFin=experience.getMoiParDonneeDeBD(tempFin);
 	}
 	
 	int idDomain =experience.getFkSociete().getFkDomaine().getId(); 
 	

 	 String listMoisDeDebut ="";
 	 listMoisDeDebut = outils.getListMoisString(moiDebut); 
 	 String	 listMoisDeFin ="";
 	listMoisDeFin=outils.getListMoisString(moiFin);
 	
 	String listAnneesDeDebut ="";
 	listAnneesDeDebut=outils.getListAnneesString(anneeDebut);
 	String listAnneesDeFin ="";
 	listAnneesDeFin=outils.getListAnneesString(anneeFin);
 	
 	String listDomaines ="";
 	listDomaines=experience.getListDomainesString(experience.getFkSociete().getFkDomaine().getId());
 	
 	boolean isSituationActuelle = utilisateur.isSituationActuelle();
 	
 	
 	
	String s="";
 	s="<div id='popUpProfil' class='popUp'>"
 			+"<div id='popUpAddExperienceProfil'>"
 			+"<div id='titre'>"
 				+"Modifier Experience"
 			+"</div>"
 			+"<div id='croix'></div>"
 			+"<div class='annuleFloat'></div>"
 			+"<div id='erreurs' class='erreurs' style='display: none'></div>"
 			+"<div id='contenu'>"
 				
 				+"<form action='ExperienceProfil.do' method='post' name='formulaire' >"
 				+"<input type='hidden' name='action' value='formModifieExperienceProfil'/>"
 				+"<input type='hidden' name='id' value='"+id+"'/>"
 				+"<input type='hidden' name='idExperience' value='"+idExp+"'/>"
 				+"<input type='hidden' name='idSociete' id ='idSociete' value=''/>"
 				
 					+"<table>"
 						+"<tr>"
 							+"<th align='right'>"
 								+"<label for='dateDeDebutLbl' id='dateDeDebutLbl'>"
 									+"<strong>Date de debut* : </strong>"
 								+"</label>"
 							+"</th>"
 							+"<td>"
 								+"<select name='moisDeDebut'  size='1'>"+listMoisDeDebut+"</select>"
 								+"<select name='anneeDeDebut'  size='1'>"+listAnneesDeDebut+"</select>"
 							+"</td>"
 						+"</tr>"
 						
 						+"<tr>"
 							+"<th align='right'>"
 								
 							+"</th>"
 							+"<td>"
 								+"<strong>Actuel:</strong><input type='checkbox' "+ checked +" name='dateDeFin1' onclick='isActuel();'/>"
 								+"<input type='hidden' name='verifActuel' value='"+isSituationActuelle +"'/>"
 							+"</td>"
 						+"</tr>"
 						
 						+"<tr>"
 							+"<th align='right'>"
 								+"<label for='dateDeFin2Lbl' id='dateDeFin2Lbl'>"
 									+"<strong>Date de fin* : </strong>"
 								+"</label>"
 							+"</th>"
 							+"<td>"
 								+"<select name='moisDeFin2' "+ disable+ " size='1'>"+listMoisDeFin+"</select>"
 								+"<select name='anneeDeFin2' "+ disable  +" size='1'>"+listAnneesDeFin+"</select>"
 							+"</td>"
 						+"</tr>"
 						
 						+"<tr>"
 							+"<th align='right'>"
 								+"<label for='domaineDActiviteLbl'>"
 									+"<strong>Domaine d'activite* : </strong>"
 								+"</label>"
 							+"</th>"
 							+"<td>"
 								+"<select name='domaineActivite'  size='1' >"+listDomaines+"</select>"
 							+"</td>"
 						+"</tr>"
 						
 						+"<tr>"
 							+"<th align='right'>"
 								+"<label for='entrepriseLbl' id='entrepriseLbl'>"
 									+"<strong>Entreprise* : </strong>"
 								+"</label>"
 							+"</th>"
 							+"<td>"
 								+"<input type='text' name='entreprise'  id='entreprise' size='30' value='"+experience.getNomEntreprise()+"'	maxlength='50' autocomplete='off' onkeyup='return autoCompletionSociete()' />"/**/
 							+"</td>"
 						+"</tr>"
 						
 						+"<tr>"
 							+"<th align='right'>"
 								+"<label for='directionLbl' id='directionLbl'>"
 									+"<strong>Direction* : </strong>"
 								+"</label>"
 							+"</th>"
 							+"<td>"
 								+"<input type='text' name='direction' size='30'	maxlength='50' value='"+experience.getDirection()+"' />"
 							+"</td>"
 						+"</tr>"
 						
 						+"<tr>"
 							+"<th align='right'>"
 								+"<label for='posteLbl' id='posteLbl'>"
 									+"<strong>Poste* : </strong>"
 								+"</label>"
 							+"</th>"
 							+"<td>"
 								+"<input type='text' name='poste' size='30' value='"+experience.getPoste()+"'	maxlength='50' />"
 							+"</td>"
 						+"</tr>"
 						
							+"<tr>"
							+"<th align='right'>"
								+"<label for='paysLbl' id='paysLbl'>"
									+"<strong>Pays* : </strong>"
								+"</label>"
							+"</th>"
							+"<td>"
								+"<input type='text' name='pays' id='pays' size='30'  value='"+experience.getFkSociete().getPays()+"'	maxlength='50' />"
							+"</td>"
						+"</tr>"
						
						+"<tr>"
							+"<th align='right'>"
								+"<label for='villeLbl' id='villeLbl'>"
									+"<strong>Ville* : </strong>"
								+"</label>"
							+"</th>"
							+"<td>"
								+"<input type='text' name='ville' id='ville' size='30' value='"+experience.getFkSociete().getVille()+"'	maxlength='50' />"
							+"</td>"
						+"</tr>"
 						
 						
 						+"<tr>"
 							+"<th align='right'>"
 								+"<label for='descriptionLbl' id='descriptionLbl'>"
 									+"<strong>Description : </strong>"
 								+"</label>"
 							+"</th>"
 							+"<td>"
 								+"<textarea rows='3' name='description' class='textarea' >"+experience.getDescription()+"</textarea>"
 							+"</td>"
 						+"</tr>"
 						   
 					+"</table>"
 			
 				
 				+"<div class='annuleFloat'></div>"
 					+"<div id='boutons'>"
 							+"<input type='submit' id='valider' value='' name='valider' onclick='return verif()'/>"
							+"</form>"
							+"<form action='profil.do' method='post' name='annulerProfil' onSubmit='true'>"
							+"<input type='submit' id='annuler' value='' name='annulerProfil'/>"
							+"<input type='hidden' name='action' value='annulerProfil'/>"
							+ "</form>"
				   + "</div>" 				
 			+"</div>"
 		+"</div>"
 	+"</div>";
 	
 	out.print(s);
 %>
 
 